{# Modal for creation of a resource attached to a compound #}
{# we only create resources from this modal #}
{% set entityPage = 'database' %}
<div class='modal fade' id='createResourceFromCompoundModal' tabindex='-1' role='dialog' aria-labelledby='createResourceFromCompoundModalTitle'>
  <div class='modal-dialog modal-lg' role='document'>
    <div class='modal-content'>
      <div class='modal-header'>
        <h5 class='modal-title' id='createResourceFromCompoundModalTitle'><i class='fas fa-fw fa-plus'></i> {{ 'Create resource from compound'|trans }}</h5>
        <button type='button' class='close' data-dismiss='modal' aria-label='{{ 'Close'|trans }}'>
          <span aria-hidden='true'>&times;</span>
        </button>
      </div>
      <div class='modal-body'>
        <div class='d-flex flex-row justify-content-between mb-2'>
          <p>{{ 'Select a resource template'|trans }}</p>
          <a href='resources-templates.php' class='btn btn-ghost btn-sm'><i class='fas fa-cogs mr-1'></i>{{ 'Manage templates'|trans }}</a>
        </div>
        {# adapt inputs expected by modal.html #}
        {% set templatesArr = itemsTemplatesArr %}
        {% set categoryArr = App.itemsCategoryArr %}
        {% include 'create-new-item-modal-body.html' with {'actionName': 'create-resource-from-compound',
          'templatesPageOverride': 'resources-templates.php', 'categoryPageOverride': 'resources-categories.php',
          'alwaysShowCategories': true
        } %}
      </div>

      <div class='modal-footer'>
        <button type='button' class='btn btn-ghost' data-dismiss='modal'>{{ 'Cancel'|trans }}</button>
      </div>
    </div>
  </div>
</div>
